package com.example.chapter2;

import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;

/**  A.	direct（发布与订阅、完全匹配）
 * 创 建 时 间: 2019/9/15
 * 版       本: V1.0
 * 作       者: qixin
 * 版 权 所 有: 版权所有(C)2019-2029
 */
@Component
@RabbitListener(
        bindings =
        @QueueBinding(
                value = @Queue(value = "${mq.config.queue.info}",autoDelete = "true"),
                exchange = @Exchange(value = "${mq.config.exchange}"),
                key = "${mq.config.queue.info.routing.key}"
        )
)
@Log4j2
public class InfoReceiver {

    @RabbitHandler
    public void process(String msg){
        log.info("接收到info日志:"+msg);
    }
}
